<?php
namespace Client\Table;

use Zend\Db\Sql\Select;
use Zend\Paginator\Adapter\DbSelect;

use Zend\Paginator\Paginator;
use Zend\Db\Sql\Where;
use Zend\Db\ResultSet\ResultSet;

class VoucherTypeTable extends CommonTable
{
    protected $table = 'hy_voucher_type';
    protected $id = 'vt_id';
     
    public function getByCode($code) {
        if (empty($code)) {
            throw new \Exception("code不存在");
        }
        
        $select = new Select(array('vt'=>$this->getTable()));
        
        $select->where(array('vt.vt_code'=>$code));

        $rowset = $this->selectWith($select);
        $row = $rowset->current();
        return $row;
    }
 
}